package com.service;

import com.bean.ArticleContent;
import com.mapper.ArticleContentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * Created by Yuicon on 2016/11/9.
 */
@Service
public class ArticleContentService {

    @Autowired
    ArticleContentMapper articleContentMapper;

    public ArticleContent findByAid(String aid){
        return articleContentMapper.findByAid(aid);
    }

    public void insert(ArticleContent articleContent){
        articleContentMapper.insert(articleContent);
    }

    public void insert(String aid, String content){
        ArticleContent articleContent = new ArticleContent(UUID.randomUUID().toString(),aid,content);
        articleContentMapper.insert(articleContent);
    }
}
